<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.rong.hibernate.Const" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>业务单据录入</title>
		<sx:head />
		<script type="text/javascript" src="js/busi.js"></script>
		<style type="text/css">
@import "css/jquery.datetimeentry.css";
</style>
		<style type="text/css">
@import "css/table.css";
</style>
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/jquery.datetimeentry.js"></script>
		<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
		<script type="text/javascript" src="js/jquery.datetimeentry-zh-CN.js"></script>
	
		<script type="text/javascript" src="js/busi.js"></script>

		<script type="text/javascript">

		</script>
	</head>
	<body >
		
		<s:form action="BusiAction.action" theme="simple" >业务单据|<a href="BusiAction!findallblist.action">业务单据列表</a>

			<table  cellspacing="0">
				<tr>
					<th style="text-align: right">
						系统编号
					</th>
					<td> 
						<s:textfield name="busi.num" label="单据编号" readonly="true"/>
					</td>
					<th style="text-align: right">
						备注
					</th>
					<td>
						<s:textfield name="busi.remark" label="备注" />
					</td>
					<th style="text-align: right">
						应放热吨位
					</th>
					<td> 
						<s:textfield name="busi.extAttr5" label="应放热吨位" value="0" readonly="true"/>
					</td>
					<th style="text-align: right">
						误差吨位
					</th>
					<td>
						<s:textfield name="busi.extAttr6" label="误差吨位"  readonly="true"/>
					</td>
					<th style="text-align: right">
						 参与奖罚	
					</th>
					<td><s:checkbox label="参与奖罚" name="busi.extAttr8" /></td>
					
				</tr>				
			</table>
            <p>
			采热方式: <!--<s:radio list="#session.map_steam" name="busi.extAttr1" value="0"/>-->
				废蒸汽<input id=busi.extAttr1 type=radio name="busi.extAttr1" value="0" checked onClick--="dirSteamHs('h')"/> 
				直接蒸汽<input id=busi.extAttr1 type=radio name="busi.extAttr1" value="1" onClick--="dirSteamHs('s')"/> 
				其他<input id=busi.extAttr1 type=radio name="busi.extAttr1" value="2"/> 
				
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			
			是否采水:<s:checkbox label="是否采水" name="busi.waterIs" value="true" onclick="hiddenwater()"/>				
			</p>
			<table  cellspacing="0">
				<tr nowrap>
					<th style="text-align: right">
						采热单号
					</th>
					<td> 
						<s:textfield name="busi.heatNum" label="采热单号" />
					</td>
					<th style="text-align: right">
						单&nbsp;据&nbsp;日&nbsp;期&nbsp;
					</th>
					<td>
						<sx:datetimepicker name="busi.heatDate" displayFormat="yyyy-MM-dd" />
					</td>
					
					<td class="td_bg"></td>
					<th style="text-align: right" class="water">
						采水单号
					</th>
					<td class="water">
						<s:textfield name="busi.waterNum" label="采水单号" />
					</td>

					<th style="text-align: right" class="water">
					单据日期
					</th>
					<td class="water">
						<s:textfield name="busi.waterDate" />
					</td>		
			  </tr>

				<tr nowrap>
					<th style="text-align: right">
						采热地点
					</th>
					<td>
						<s:select label="选择采热地点" list="#session.company_list_suply"
							name="busi.heatComId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="----" emptyOption="false"/>
					</td>
						<th style="text-align: right" id="dirsteamStartth">
						汽水表起数(选)
					</th>
					<td  id="dirsteamStart"><s:textfield name="busi.extAttr3" label="汽水表开始读数"  onblur="steamSum()"/>	</td>
					<td class="td_bg"></td>
					<th style="text-align: right" class="water">
						采水地点
					</th>
					<td class="water">
						<s:select label="选水采热地点" list="#session.company_list_suply"
							name="busi.waterComId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="----" emptyOption="false" />
					</td>
					<th style="text-align: right" class="water">						
					</th>
					<td class="water"></td>	
                  </tr>
				</tr>

				<tr nowrap>
					
					<th style="text-align: right">
						车辆
					</th>
					<td>
						<s:select label="选择车辆" list="#session.car_list"
							name="busi.heatCarId" listKey="id" listValue="num" headerKey="-1"
							headerValue="---" emptyOption="false" />

					</td>  
                       
					<th style="text-align: right"  id="dirsteamEndth">
						汽水表止数(选)
					</th>
					<td  id="dirsteamEnd"><s:textfield name="busi.extAttr4" label="汽水表结束读数" onblur="steamSum()"/></td>
					<td class="td_bg"></td>
					
					
					<th style="text-align: right" class="water">
						水表开始读数
					</th>
					<td class="water">
						<s:textfield name="busi.waterMeterStar" label="水表开始读数"  onblur="waterSum_1()"/>
					</td>
					
					
					
					<th style="text-align: right" class="water">
						水表结束读数
					</th>
					<td class="water">
						<s:textfield name="busi.waterMeterEnd" label="水表结束读数"  onblur="waterSum_1()"/>
					</td>
					
                 </tr>
                 <tr nowrap>
                    <th style="text-align: right">
						采热成本
					</th>
					<td>
						<s:hidden name="busi.heatPrice" label="采热单价" /> <!-- 废蒸汽方式，采热单价极为采热成本；直接蒸汽方式采热成本=单价×水表走数 -->
						<s:textfield name="busi.heatSum" label="采热成本金额" />
						
					</td>
					<th style="text-align: right">
						
					</th>
					<td> </td>
					<td class="td_bg"></td>
					
					
					<th style="text-align: right" class="water">
						
					</th>
					<td class="water">
					<!--  
						<s:select label="选择车辆" list="#session.car_list"
							name="busi.waterCarId" listKey="id" listValue="num" headerKey="-1"
							headerValue="---" emptyOption="false" />
							-->
						<s:hidden name="busi.waterCarId" />	

					</td>
						<th style="text-align: right" class="water">
						采水成本
					</th>
					<td class="water">
						<s:textfield name="busi.waterSum" label="采水成本金额" onblur="waterSum_1()"/>
						
						<s:hidden name="busi.waterPriceId"/>
						<s:hidden name="busi.waterPrice" />
						
					</td>
				
                 
			</table>


			<!--客户销售部分 -->
     <p>   客户销售结算 </p>
          <table id="sellTable" class="pill" cellspacing="0">
				<tr>
					
					<th>
						供热类型
					</th>
					<th>
						客户
					</th>
					
					<th>
						原始单号
						<font color="red">(*)</font>
					</th>
					<th>
						结算方式
					</th>
					<th>
						结算单价
					</th>
					
					<th>
						水表起
					</th>
					<th>
						水表止
					</th>
					
					<th>
						结算数量
					</th>
					
					<th>
						金额
					</th>
					
					
					<th>
						原水温
					</th>
					<th>
						放热温度
					</th>
					<th>
						备注
					</th>
					<th>
						
					</th>
				</tr>

				<tr>					
						
					<td>
						<s:select label="供热类型" list="#session.map_heat_style"
							name="sellList[0].extattr1" listKey="key" listValue="value" emptyOption="false" />
					</td>
					<td>
					    <s:hidden name="sellList[0].comFromId"  />
						<s:select label="放热地点" list="#session.company_list_custom"
							name="sellList[0].comToId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="----" emptyOption="false" />
					</td>
					
					<td>
						<s:hidden name="sellList[0].carId"  />	
						<s:textfield name="sellList[0].sellNum" />
					</td>
					<td>
						<s:select label="结算方式" list="#session.statmap"
							name="sellList[0].stmtStyle" listKey="key" listValue="value"
							headerKey="-1" headerValue="----" emptyOption="false" />
						<!--<s:textfield name="sellList[0].stmtStyle"/>-->
					</td>
					<td>
						<s:hidden name="sellList[0].priceId" />
						<s:textfield name="sellList[0].price" />
					</td>
					<td>
						<s:textfield name="sellList[0].meterStart" />
					</td>
					<td>
						<s:textfield name="sellList[0].meterEnd" />
					</td>		
					<td>
						<s:textfield name="sellList[0].amount" />
					</td>
					
					<td>
					<s:hidden name="sellList[0].sumPlus" />
						<s:textfield name="sellList[0].sum" readonly="true"/>
					</td>
								
					<td>
					<s:hidden name="sellList[0].offerHeatTime" />
						<s:textfield name="sellList[0].cstmTemptStart" />
					</td>
					<td>
						<s:textfield name="sellList[0].cstmTemptEnd" />
						<input  type="hidden"  name="sellList[0].carv" value="0.0"/> <!-- 车辆容积 -->
						<input  type="hidden"  name="sellList[0].upTemprature" value="${upTemprature}"/><!-- 充热温度 -->
						<input  type="hidden"  name="sellList[0].sHeatAmount" value="0"/><!-- 应放热吨位 -->
						<input  type="hidden"  name="sellList[0].fangreAmount" value="0"/><!-- 车辆水箱的标准放热量 -->
					</td>
					<td>
						<s:textfield name="sellList[0].remark" />
						<s:hidden name="sellList[0].extattrDoub5" value="0.0" readonly="true"/> <!-- 已收金额（包括正常已收金额，和呆账的已收金额，按核销状态区分是否呆账）,录入状态下默认为0 -->
					
					</td>
					
					<td>
					<a href="#" onclick="deleRec(this)" name="sellList[0].deleRec" >删除 </a>
					</td>
					
						
				</tr>

			</table>
			<p id="sellTaltolSum">金额合计：<s:textfield name="busi.sellTaltolSum" label="销售金额合计" readonly="true" /></p>
			<p>
				<input type="button" value="增加记录" onclick="addsell()" />
				<input  type="hidden"  id="totalAmount" name="busi.totalAmount" value="0"/> <!--总的结算数量 -->
			</p>



			<!-- 运费部分 -->
<p>是否承包方结算:<s:checkbox label="是否承包方结算" name="busi.extAttr7" value="true"  onclick="hiddentransf()"/></p>
           <table id="transTable" class="pill" cellspacing="0">
				<tr>
					<th>
						热源地
					</th>
					<th>
						客户
					</th>
					
					<th nowrap>
						原始单号
						<font color="red">(*)</font>
					</th>
					<th>
						结算方式
					</th>
					<th>
						单价
					</th>
					<th>
						数量
					</th>
					
					<th>
						金额
					</th>
					<th>
						里程表起
					</th>
					<th>
						里程表止
					</th>
					<th>
						备注
					</th>
					<th>
					</th>
				</tr>

				<tr>
					<td>
						<s:select label="采热地点" list="#session.company_list_suply"
							name="transfList[0].comFromId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="---" emptyOption="false" />
					</td>
					<td>
						<s:select label="客户" list="#session.company_list_custom"
							name="transfList[0].comToId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="---" emptyOption="false" />
					</td>
					
					<td>
					<s:hidden name="transfList[0].carId"  />	 	
						<s:textfield name="transfList[0].tranNum" />
					</td>
					<td>
						<s:select label="结算方式" list="#session.statmap"
							name="transfList[0].stmtStyle" listKey="key" listValue="value"
							headerKey="-1" headerValue="----" emptyOption="false" />
						<!--<s:textfield name="transfList[0].stmtStyle"/>-->
					</td>
					<td>
						<s:hidden name="transfList[0].priceId" />
						<s:textfield name="transfList[0].price" />
					</td>
					<td>
						<s:textfield name="transfList[0].amount" />
					</td>

					<td>
					    <s:hidden name="transfList[0].sumPlus" />
						<s:textfield name="transfList[0].sum"  readonly="true"/>
					</td>
					<td>
						<s:textfield name="transfList[0].meterStart" />
					</td>
					<td>
						<s:textfield name="transfList[0].meterEnd" />
					</td>
					<td>
						<s:textfield name="transfList[0].remark" />
					</td>
					
					<td>
					<a href="#" onclick="deleRec(this)" name="transfList[0].deleRec" >删除 </a>
					</td>
				</tr>

			</table>
			<p id="transfTaltolSum">金额合计：<s:textfield name="busi.transfTaltolSum" label="运输金额合计" readonly="true" /></p>
			<p id="transfTaltolbutton">
				<input type="button" value="增加记录" onclick="add()" />
			</p>

			<table  cellspacing="0">
				<tr>
					<td style="text-align: right">
						<s:submit value="保存" />
					</td>
					<td style="text-align: left">
						<s:reset value="取消" />
					</td>

					<td style="text-align: left">
						${busi.num} ${saveFlag}
					</td>

				</tr>
			</table>
		</s:form>
		<s:fielderror cssStyle="color:red" />
	</body>
</html>
